package com.nucarf.bi.digtalize.util;

import com.alibaba.fastjson.JSON;
import com.nucarf.bi.digtalize.bean.Content;
import com.nucarf.bi.digtalize.bean.FeishuWarn;

public class FeiShuWarnUtil {

    public static void sendFeishuWarning(String message) {
        FeishuWarn feishuWarn = new FeishuWarn();
        feishuWarn.setMsg_type("text");
        Content content = new Content();
        content.setText(message);
        feishuWarn.setContent(content);
        try {
            PostHttpUtil.sendPostJson(PropertyUtil.getPropertyValue("feishu.webhook"), JSON.toJSONString(feishuWarn), null);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public static void main(String[] args) {
        sendFeishuWarning("flink 测试飞书报警");
    }

}
